package com.wy.tranFile.util;

/**
 * @author 吴宇~
 * @motto 我亦无他，唯手熟尔。
 * @edition jdk1.8
 * @reflection 0-1 喧闹任其喧闹，自由我自为之，我自风情万种，与世无争。
 * @date 2024/06/30/21:52
 * @target 心若有所向往，何惧道阻且长
 */
public class StringUtils {
    public static int countCharacters(String str, char... characters) {
        int totalCount = 0;
        for (char character : characters) {
            int index = str.indexOf(character);
            while (index != -1) {
                totalCount++;
                index = str.indexOf(character, index + 1);
            }
        }
        return totalCount;
    }
}
